package com.hbm.usercenter.activity;

import android.content.Intent;
import android.os.Bundle;
import android.widget.Button;
import android.widget.TextView;

import com.hbm.usercenter.R;
import com.hbm.usercenter.base.BaseActivityCommon;
import com.hbm.usercenter.view.FNRadioGroup;

import butterknife.Bind;
import butterknife.ButterKnife;
import butterknife.OnClick;

public class MyPromoteActivity extends BaseActivityCommon {

    @Bind(R.id.rg)
    FNRadioGroup mRg;
    @Bind(R.id.btn_confirm)
    Button mBtnConfirm;
    @Bind(R.id.tv_price)
    TextView mTvPrice;

    @Override
    protected void initView() {
        setContentView(R.layout.activity_my_promote);
        ButterKnife.bind(this);
        initToolbar("红包互粉");

    }

    @Override
    protected void initListener() {
        mRg.setOnCheckedChangeListener(new FNRadioGroup.OnCheckedChangeListener() {
            @Override
            public void onCheckedChanged(FNRadioGroup group, int checkedId) {
                switch (group.getCheckedRadioButtonId()) {
                    case R.id.rb_1:
                        mTvPrice.setText("￥0.01");
                        break;
                    case R.id.rb_2:
                        mTvPrice.setText("￥200.1");
                        break;
                    case R.id.rb_3:
                        mTvPrice.setText("￥200.2");
                        break;
                    case R.id.rb_4:
                        mTvPrice.setText("￥1100.2");
                        break;
                    case R.id.rb_5:
                        mTvPrice.setText("￥1101.2");
                        break;
                    case R.id.rb_6:
                        mTvPrice.setText("￥1101.2");
                    case R.id.rb_7:
                        mTvPrice.setText("￥1801.2");
                        break;
                    default:
                        break;
                }
            }
        });
    }

    @OnClick(R.id.btn_confirm)
    public void onViewClicked() {
        String price = mTvPrice.getText().toString();
        Intent intent = new Intent(this,PromotePayActivity.class);
        Bundle extras = new Bundle();
        extras.putString(PromotePayActivity.PRICE_DATA, price);
        intent.putExtras(extras);
        startActivity(intent);

    }
}
